<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>论坛</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="css/font.css">
	<link rel="stylesheet" href="css/xadmin.css">
    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>

</head>
<body>

    <div class="container">
        <div class="logo"><a href="index.jsp">论坛</a></div>
        <div class="left_open">
            <i title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
       
       <%
	String sf = request.getParameter("sf");
	if("tourist"==sf||"tourist".equals(sf))
	{
		request.getSession().setAttribute("username", null);
		request.getSession().setAttribute("userrole", null);
	}	
	String username = (String)request.getSession().getAttribute("username");
	String userrole = (String)request.getSession().getAttribute("userrole");
	if(username!=null)
	{
      %>
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
          <%
          if(userrole=="user"||"user".equals(userrole)){
          %>
            <a href="index_user.jsp?sf=user">用户${username}</a>
            <a href="index.jsp?sf=tourist">退出</a>
            <%
          }
          else{
            %>
            <a href="index_admin.jsp?sf=admin">管理员${username}</a>
            <a href="index.jsp?sf=tourist">退出</a>
            <%
          }
            %>
          </li>
        <% 
         }
else {
        %>
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
            <a href="login.jsp">登录</a>
            <a href="regist.jsp">注册</a>
        </li>
        <%
           }
        %>
        </ul>

    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
     <!-- 左侧菜单开始 -->
    <div class="left-nav">
      <div id="side-nav">
        <ul id="nav">
             <li >
                <a href="javascript:;">
                    <cite><a href="ListMessageServlet?pageIndex=1" target="showiframe">全部</a></cite>
                </a>
            </li>
             <li >
                <a href="javascript:;">                
                    <cite><a href="ListMessageServlet?type=shenghuo&pageIndex=1" target="showiframe">生活</a></cite>                  
                </a>
               
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=qinggan&pageIndex=1" target="showiframe">情感</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=yule&pageIndex=1" target="showiframe">娱乐</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=gaoxiao&pageIndex=1" target="showiframe">搞笑</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=xinwen&pageIndex=1" target="showiframe">新闻</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=tiyu&pageIndex=1" target="showiframe">体育</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=youxi&pageIndex=1" target="showiframe">游戏</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=xiaoshuo&pageIndex=1" target="showiframe">小说</a></cite></a>
      
            </li>
            <li>
             <a href="javascript:;">  
               <cite><a href="ListMessageServlet?type=dongman&pageIndex=1" target="showiframe">动漫</a></cite></a>
      
            </li>             
      </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src='index2.jsp' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
            </div>
          </div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
    <!--<div class="footer">
        <div class="copyright">Copyright ©2019 L-admin v2.3 All Rights Reserved</div>  
    </div>-->
    <!-- 底部结束 -->
</body>
</html>